package com.depository.oss.mapper;

import com.depository.oss.model.entity.User;
import com.depository.oss.provider.UserProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {

    @SelectProvider(type = UserProvider.class, method = "queryForPage")
    List<User> queryForPage();

    /*@Select("select id id,login_name loginName,login_password loginPassword from user_info2 where id=#{id}")*/
    @SelectProvider(type = UserProvider.class, method = "getUser")
    User getUser(@Param("id") String id);

    /*@Insert("insert into user_info2(id,login_name,login_password) values (#{user.id},#{user.loginName},#{user.loginPassword})")
    int insertUser(@Param("user") User user);*/
    @InsertProvider(type = UserProvider.class, method = "insertUser")
    void insertUser(User user);

    /*@Update("update user_info2 set login_name=#{user.loginName},login_password=#{user.loginPassword} where id=#{user.id}")
    *  int updateUser(@Param("user") User user);*/
    @UpdateProvider(type = UserProvider.class, method = "updateUser")
    void updateUser(User user);
}

